<div id="{{form.id}}" class="db-form">
    <table class="db-form-table" role="form" ng-init="form.data=form.data||{}">
        <tr class="form-group" ng-repeat="item in form.layout.items">
            <td ng-if="item.inline&&!item.noLabel">
                <label class="control-label">{{item.field.display}}</label>
            </td>
            <td ng-if="item.inline" colspan="{{item.noLabel?2:1}}">
                <div ng-repeat="(idx, input) in item.field.inputs" class="{{input.class}}">
                    <div ng-if="['checkbox','radio','listview'].indexOf(input.type)<0">
                        <input ng-model="form.data[item.field.prop][idx]"
                               ng-if="input.type!='select'&&input.type!='button'" type="{{input.type}}"
                               class="form-control"
                               placeholder="{{input.placeholder}}">
                        <button ng-if="input.type=='button'" class="btn btn-default btn-xs">{{input.placeholder}}
                        </button>
                        <select ng-model="form.data[item.field.prop][idx]"
                                ng-if="input.type=='select'" ng-options="option for option in input.placeholder"
                                class="form-control"></select>
                    </div>
                    <div ng-if="input.type=='checkbox'" class="checkbox">
                        <label>
                            <input type="checkbox" ng-model="form.data[item.field.prop][idx]">{{input.placeholder}}
                        </label>
                    </div>
                    <div ng-if="input.type=='radio'" class="radio">
                        <label>
                            <input type="radio" ng-model="form.data[item.field.prop][idx]" name="{{input.group}}"
                                   value="{{input.value}}">{{input.placeholder}}
                        </label>
                    </div>
                    <div ng-if="input.type=='listview'">

                    </div>
                </div>
            </td>
            <td ng-if="!item.inline&&!item.split" colspan="{{form.layout.colspan}}">
                <label ng-if="item.label" class="control-label">{{item.field.display}}</label>
                <input ng-model="form.data[item.field.prop][item.idx]"
                       ng-if="!item.label&&item.common&&['listview'].indexOf(item.input.type)<0"
                       type="{{item.input.type}}"
                       class="form-control"
                       placeholder="{{item.input.placeholder}}">
                <textarea ng-model="form.data[item.field.prop][item.idx]"
                          ng-if="!item.label&&item.input.type=='textarea'"
                          class="form-control"
                          placeholder="{{item.input.placeholder}}"></textarea>
                <select ng-model="form.data[item.field.prop][item.idx]"
                        ng-if="!item.label&&item.input.type=='select'"
                        ng-options="option for option in item.input.placeholder"
                        class="form-control"></select>

                <div ng-if="item.input.type=='listview'"
                     style="min-height: {{item.input.minHeight}}"
                     class="{{item.input.box?'listview-box':''}}">
                    <div class="list-group">
                        <a ng-repeat="option in item.input.placeholder" href="#" class="list-group-item">{{option}}</a>
                    </div>
                </div>
            </td>
            <td ng-if="item.split" colspan="{{form.layout.colspan}}">
                <div class="split"></div>
            </td>
        </tr>
    </table>
</div>